package com.dongge.dao;

import com.dongge.entity.Authorization;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zhudong on 2016/8/17.
 */
@Repository
public class AuthorizationDao extends BaseDao {

    public List<Authorization> getAuthorizationsByRoleId(long id){
        Session session = getSession();
        String hql = "select a from Authorization a left join  a.roleSet r with r.id=:id";
        return session.createQuery(hql).setLong("id",id).list();
    }
}
